import sys
from exceptions import Exception

class RaiseError:
	
	def __init__(self, error):
		self.error = error
		
	def search(self):
		self.__run = hasattr(sys.modules[self.__module__], "%sError" % self.error) \
			and getattr(sys.modules[self.__module__], "%sError" % self.error) or DefaultError
		return self.__run
		
class DefaultError(Exception):

	def __str__(self):
		return "Default Error."
		
class GladeError(Exception): pass

class XMLError(Exception): pass
class ConfigError(XMLError): pass
